import xadmin

from apps.operation.models import BlogComments,MessageComments

class BlogCommentsAdmin(object):
    list_display = ["blog", "user", "comments",'is_see', "add_time"]
    search_fields = ["blog", "user", "comments",'is_see', "add_time"]
    list_filter = ["blog", "user", "comments",'is_see', "add_time"]
    list_editable = ["blog", "user", "comments",'is_see', "add_time"]
    # 只读
    readonly_fields = ["add_time"]

class MessageCommentsAdmin(object):
    list_display = ["blog", "user", "comments",'is_see', "add_time"]
    search_fields = ["blog", "user", "comments",'is_see', "add_time"]
    list_filter = ["blog", "user", "comments",'is_see', "add_time"]
    list_editable = ["blog", "user", "comments",'is_see', "add_time"]
    # 只读
    readonly_fields = ["add_time"]

xadmin.site.register(BlogComments, BlogCommentsAdmin)
xadmin.site.register(MessageComments, MessageCommentsAdmin)


